SOURCE = tc.c
OBJECT = tc.o

run: all
	sudo LD_LIBRARY_PATH=./target/release/cangjie_libbpf:$$LD_LIBRARY_PATH ./target/release/bin/main


all: build_bpf build_cj

build_cj:
	cjpm build

build_bpf: $(OBJECT)

$(OBJECT): $(SOURCE)
	clang -g -O2 -target bpf -c $^  -o $@

clean:
	rm -rf target/
	rm -rf $(OBJECT)


debug:
	sudo LD_LIBRARY_PATH=./target/debug/cangjie_libbpf:$$LD_LIBRARY_PATH /home/hevienz/.cangjie/cangjie/tools/bin/cjdb ./target/debug/bin/main

